/**
 * Created by Daniel on 2017/9/19.
 */
var router = require('express').Router();
var AV = require('leanengine');
var functionTool = require('../queryFun/functionTool');

var Todo = AV.Object.extend('Todo');

router.get('/', function(req, res, next) {
    var currentUser = req.currentUser;
    if (currentUser==''||currentUser==undefined||currentUser==null) {
        res.render('index',{});
    }
    else {
        res.render('edit/editor', {});
    }
});

router.get('/login', function(req, res, next) {
  var currentUser = req.currentUser;
  if (currentUser==''||currentUser==undefined||currentUser==null) {
    res.render('index',{});
  }
  else {
    res.render('edit/editor', {});
  }
});


router.get('/logout', function(req, res, next) {
    res.clearCurrentUser();
    res.render('index',{});
});

router.get('/apkUploadSuccess', function(req, res, next) {
    console.log(req.query);
    console.log(res);
});

router.post('/apkUploadSuccess', function(req, res, next) {
    console.log(req.body);
    console.log(res);
});

module.exports = router;